<template>
  <div class="cards">
    <div class="cards-header">
      <span>{{ title }}</span>
      <i class="el-icon-warning-outline"></i>
    </div>
    <div class="cards-main">
      <div class="cards-main-value">{{ value }}</div>
      <div class="cards-main-container"><slot /></div>
    </div>
    <div class="cards-footer"><slot name="footer" /></div>
  </div>
</template>

<script>
export default {
  name: 'Cards',
  props: {
    title: {
      type: String,
      default: '请传入name'
    },
    value: {
      type: String,
      default: '请传入value'
    }
  }
}
</script>

<style lang="scss" scoped>
.cards {
  color: #303133;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  padding: 20px;
}
.cards-header {
  display: flex;
  justify-content: space-between;
  span,
  i {
    color: rgba(0, 0, 0, 0.45);
    font-size: 14px;
  }
}
.cards-main {
  padding: 10px 0 5px 0;
  margin-bottom: 5px;
  border-bottom: 1px solid #f0f0f0;
}
.cards-main-value {
  color: rgba(0, 0, 0, 0.85);
  font-size: 30px;
}
.cards-main-container {
  height: 50px;
  display: flex;
  align-items: flex-end;
}
</style>
